package com.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

/**
 * 管理员实体类
 * 对应数据库表: tb_admin
 * 
 * @author Simon
 * @since 2025-09-09 19:31
 */
@Data
@TableName("tb_admin")
@Schema(name = "Admin", description = "管理员信息")
public class Admin {

    /**
     * 主键，自增
     */
    @Schema(description = "管理员ID", example = "1")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名
     */
    @Schema(description = "用户名", example = "admin", required = true)
    @TableField("username")
    private String username;

    /**
     * 密码
     */
    @Schema(description = "密码", example = "123456", required = true, accessMode = Schema.AccessMode.WRITE_ONLY)
    @TableField("password")
    private String password;

    /**
     * 密码盐
     */
    @Schema(description = "密码盐值", accessMode = Schema.AccessMode.READ_WRITE, hidden = true)
    @TableField("salt")
    private String salt;

    /**
     * 真实姓名
     */
    @Schema(description = "真实姓名", example = "张管理员")
    @TableField("real_name")
    private String realName;

    /**
     * 电话
     */
    @TableField("phone")
    private String phone;

    /**
     * 邮箱
     */
    @TableField("email")
    private String email;

    /**
     * 状态 0=正常 1=禁用
     */
    @TableField("status")
    private Integer status;

    /**
     * 最后登录时间
     */
    @TableField("last_login_time")
    private Date lastLoginTime;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

}